home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / utility / flex236.zip / MAKEFILE < prev    next >
Text File  |  1990-11-01  |  4KB  |  172 lines

  1. # make file for "flex" tool
  2.  
  3. # $Header: e:/gnu/flex/RCS/makefile 2.3.6.1 90/10/27 22:27:33 tho Exp $
  4.  
  5. # the first time around use "make first_flex"
  6.  
  7. BINDIR    = c:/bin
  8. LIBDIR    = d:/usr/lib
  9. INCDIR    = d:/usr/include
  10.  
  11. vpath %.c $(LIBDIR)
  12. vpath %.h $(INCDIR)
  13.  
  14. BUILD    = debug
  15. MODEL    = L
  16. MSC    = 600
  17.  
  18. INSTALL = cp -f
  19. DISK    = b
  20. ZIPFILE = flex23
  21.  
  22. SKELETON_FILE = $(LIBDIR)/flex.skel
  23. SKELFLAGS = -DDEFAULT_SKELETON_FILE=\\"$(SKELETON_FILE)\\"
  24. DEFS = -A$(MODEL) -W$(WARNINGLEVEL) -DUSG -DMS_DOS -Za -DSTDC_HEADERS
  25.  
  26. ifeq ($(MSC),600)
  27. WARNINGLEVEL = 4
  28. else
  29. WARNINGLEVEL = 3
  30. endif
  31.  
  32. ifeq ($(BUILD),debug)
  33. CFLAGS    = -Od -Zi $(DEFS)
  34. CRIPPLED_CFLAGS = $(CFLAGS)
  35. LDFLAGS    = /co/st:8000/noe/far setargv
  36. else
  37. CFLAGS    = -Ox $(DEFS)
  38. ifeq ($(MSC),600)
  39. CRIPPLED_CFLAGS = -Ocegit -Gs $(DEFS)
  40. else
  41. CRIPPLED_CFLAGS = $(CFLAGS)
  42. endif
  43. LDFLAGS = /e/st:8000/noe/far setargv
  44. endif
  45.  
  46. COMPRESSION =
  47. FLEX_FLAGS = -ist8 -Sflex.ske
  48.  
  49. # which "flex" to use to generate scan.c from scan.l
  50. FLEX    = flex
  51.  
  52. OBJS    = ccl.obj dfa.obj ecs.obj gen.obj main.obj misc.obj nfa.obj \
  53.       parse.obj scan.obj sym.obj tblcmp.obj yylex.obj $(LIBS)
  54. SRCS    = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c \
  55.       parse.y  scan.l sym.c tblcmp.c yylex.c
  56. INCS    = flexdef.h
  57. DOCS    = flex.1 flexdoc.1 flex.man flexdoc.man
  58.  
  59. LIBS    = _cwild.obj
  60. LOADLIBES= gnulib_$(MODEL)
  61.  
  62. LIBOBJS    = libmain.obj
  63. FLEXLIB    = flexlib.lib
  64.  
  65. RCSFILES= changes flex.ske makefile $(SRCS) $(INCS) initscan.c
  66. MISC    = readme readme.dos $(DOCS) tar.-tv \
  67.       misc/atari.pat misc/makefile.vms misc/msdos.not \
  68.       misc/readme misc/turbo-c.not
  69.  
  70. .PHONY: all
  71. all: flex.exe $(FLEXLIB)
  72.  
  73. flex.exe: $(OBJS)
  74.     $(LINK) $(LDFLAGS) $^, $@, nul, $(LOADLIBES),,
  75.  
  76. .PHONY: first_flex
  77. first_flex: initscan.c
  78.     cp $^ scan.c
  79.     $(MAKE) $(MFLAGS) flex.exe
  80.  
  81. .PHONY: install
  82. install: flex.exe flex.ske flexdef.h
  83.     $(INSTALL) flex.exe $(BINDIR)
  84.     $(INSTALL) flex.ske $(LIBDIR)
  85.     $(INSTALL) flexdef.h $(INCDIR)
  86.  
  87. parse.h parse.c : parse.y
  88.     $(YACC) -d parse.y
  89.     @mv -f y_tab.c parse.c
  90.     @mv -f y_tab.h parse.h
  91.  
  92. scan.c : scan.l ./flex.ske
  93.     $(FLEX) $(FLEX_FLAGS) $(COMPRESSION) scan.l >scan.c
  94.  
  95. scan.obj : scan.c parse.h flexdef.h
  96.  
  97.  
  98. # MSC 6.0's loop optimizations break this.
  99. tblcmp.obj : tblcmp.c flexdef.h
  100.     $(CC) $(CRIPPLED_CFLAGS) $(CPPFLAGS) -c $<
  101.  
  102. # Ugly kludge to work around MSC 6.0 environment parsing bug...
  103. # (works only with my GNU make)
  104. main.obj : main.c flexdef.h
  105.     CL $(CFLAGS) -c $(SKELFLAGS) $(CPPFLAGS) main.c
  106.  
  107. ccl.obj : ccl.c flexdef.h
  108. dfa.obj : dfa.c flexdef.h
  109. ecs.obj : ecs.c flexdef.h
  110. gen.obj : gen.c flexdef.h
  111. misc.obj : misc.c flexdef.h
  112. nfa.obj : nfa.c flexdef.h
  113. parse.obj : parse.c flexdef.h
  114. sym.obj : sym.c flexdef.h
  115. yylex.obj : yylex.c flexdef.h
  116.  
  117. $(FLEXLIB) : $(LIBOBJS)
  118.     $(AR) $(FLEXLIB) $(ARFLAGS) $^,,,,
  119.  
  120. tags: $(SRCS)
  121.     etags *.c
  122.  
  123. .PHONY: clean veryclean
  124. clean:
  125.     $(RM) $(OBJS) scan.c parse.c parse.h errs tags
  126.  
  127. veryclean: clean
  128.     $(RM) flex.exe patches flex.0[0-9]
  129.     rcsclean $(RCSFILES)
  130.  
  131. include make.inc
  132.  
  133. .PHONY: test bigtest
  134. test : flex.exe
  135.     flex $(FLEX_FLAGS) $(COMPRESSION) scan.l | diff -s scan.c -
  136.  
  137. bigtest :
  138.     rm -f scan.c
  139.     $(MAKE) COMPRESSION="-C" test
  140.     rm -f scan.c
  141.     $(MAKE) COMPRESSION="-Ce" test
  142.     rm -f scan.c
  143.     $(MAKE) COMPRESSION="-Cm" test
  144.     rm -f scan.c
  145.     $(MAKE) COMPRESSION="-Cfe" test
  146.     rm -f scan.c
  147.     $(MAKE) COMPRESSION="-CFe" test
  148.     rm -f scan.c
  149.     $(MAKE) COMPRESSION="-Cf" test
  150.     rm -f scan.c
  151.     $(MAKE) COMPRESSION="-CF" test
  152.     rm -f scan.c
  153.     $(MAKE)
  154.  
  155.  
  156. PACKETSIZE = 58
  157.  
  158. .PHONY: dist
  159. dist: flex.01
  160.  
  161. flex.01: copying readme.dos makefile flex.exe patches
  162.     shar -Cb16 -F -an'GNUish MS-DOS flex' \
  163.         -L$(PACKETSIZE) -o $(basename $@) $^
  164.  
  165. # It would be easier if I really kept it in RCS ...
  166.  
  167. patches: flex.ske flexdef.h misc.c initscan.c
  168.     rcsdiff -c -r2.3.0.3 flex.ske flexdef.h > $@
  169.     rcsdiff -c -r2.3.6.1 misc.c >> $@
  170.     rcsdiff -c -r2.3 initscan.c >> $@
  171.     rcsdiff -c -r2.3 parse.y >> $@
  172.